package com.lnu.information.exception;

import java.util.Scanner;

/**
 * @author : jian.zhang-2
 * @description:
 * @date : Create in 3:53 PM 2022/4/28
 * @modified By :
 */
public class AssertEx {
    public static void main(String[] args) {
        int a[] = new int[10];
        int sum = 0;
        Scanner r = new Scanner(System.in);
        for(int i = 0; i < a.length; i++){
            a[i] = r.nextInt();
            assert a[i]>=0:"负数不能为成绩";
            sum+=a[i];
        }
        r.close();
        System.out.println("总成绩为：" + sum);
    }
}
